#include <iostream>
#include <vector>
using namespace std;
const int N = 100000 + 10;
int disc[N], low[N];
vector<int> adj[N];
bool is_ap[N];
int n, m;
int timer;

void tarjan_child(int u) {
  disc[u] = low[u] = ++timer;
  for (auto v : adj[u]) {
    if (!disc[v]) {
      tarjan_child(v);
      low[u] = min(low[u], low[v]);
      // 情形 2
      if (low[v] >= disc[u]) {
        is_ap[u] = true;
      }
    }
    low[u] = min(low[u], disc[v]);
  }
}

void tarjan(int u) {
  disc[u] = low[u] = ++timer;
  int child = 0;
  for (auto v : adj[u]) {
    if (!disc[v]) {
      tarjan_child(v);
      low[u] = min(low[u], low[v]);
      child++;
    }
    low[u] = min(low[u], disc[v]);
  }
  // 情形 1
  if (child >= 2) is_ap[u] = true;
}

int main() {
  // input
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }

  // solve
  // 将每个点视为根节点，进行一次 dfs
  // 如果已经被遍历过，则不必再进行一次
  for (int i = 1; i <= n; ++i)
    if (disc[i] == 0) tarjan(i);

  // output
  int count_ap = 0;
  for (int i = 1; i <= n; ++i)
    if (is_ap[i]) count_ap++;
  cout << count_ap << '\n';
  for (int i = 1; i <= n; ++i)
    if (is_ap[i]) cout << i << ' ';
  cout << '\n';
  return 0;
}
